package com.database;

import java.sql.*;

import com.Helper.*;

public class mainDB
{
	private static Connection connection = null;
	
	public static void ConnectDB()
	{
		String connectionString = "jdbc:mysql://localhost/planesimple?user=root&password=ubc12345";
		try
        {
            // Ensure the SQL Server driver class is available.
            Class.forName("com.mysql.jdbc.Driver");

            // Establish the connection.
            connection = DriverManager.getConnection(connectionString);
        }
        // Exception handling
        catch (ClassNotFoundException cnfe)  
        {

            System.out.println("ClassNotFoundException " +
                               cnfe.getMessage());
        }
        catch (Exception e)
        {
            System.out.println("Exception " + e.getMessage());
            e.printStackTrace();
        }
	}

	public static void main(String[] args) throws SQLException
	{
		ConnectDB();
			
		TestDriver.Setup(connection);
		TestDriver.InsertTest();
	}

}
